/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.farent.solutions.plugins.stripes.hyperstripes.core.tags;

import com.farent.solutions.plugins.stripes.hyperstripes.core.ajax.AjaxResponseInsert;
import com.farent.solutions.plugins.stripes.hyperstripes.core.ComponentModel;
import com.farent.solutions.plugins.stripes.hyperstripes.core.ComponentTagHandler;

/**
 *
 * @author user
 */
public abstract class AbstractComponentTagHandler implements ComponentTagHandler{

    @Override
    public abstract String createContent(ComponentModel model, Object bindings);

    @Override
    public String createScripts(ComponentModel model) {
        return "";
    }

    @Override
    public AjaxResponseInsert createAjaxInsert(ComponentModel model, Object bindings) {
        AjaxResponseInsert responseInsert = new AjaxResponseInsert();
        String output =  createContent(model, bindings);
        responseInsert.setElementValue(output);
        return responseInsert;
    }
}
